cmake_minimum_required(VERSION 2.6)

project(VideoSourceKinectDemo)
set(Boost_USE_STATIC_LIBS   ON)
find_package(Boost REQUIRED program_options serialization filesystem )
find_package(Qt4 REQUIRED QtCore QtGui)
find_package(OpenNI REQUIRED)

include(${QT_USE_FILE})
include_directories(
   ${BTL2_INCLUDE_DIRS}
   ${BTL2_EXTRA_INCLUDE_DIRS}
   ${OpenNI_INCLUDE_DIR}
   ${Boost_INCLUDE_DIR}
   ${FREEGLUT_INCLUDE}
)

set(MOC_HEADERS
   QVideoSourceDemoKinectApplication.hpp
)

set(HEADERS
   ${MOC_HEADERS}
)

set(SOURCES
   main.cpp
)

link_directories( ${Boost_LIBRARY_DIR} )

set(LIBS
   ${Boost_LIBRARIES}
   ${QT_LIBRARIES}
   ${OpenNI_LIBRARIES}
   ${FREEGLUT_LIBRARY}
)

find_package(UEye)

if(UEye_FOUND)
   if(UNIX)
      add_definitions(-D__LINUX__)
   endif(UNIX)
   set(LIBS ${LIBS} ${UEye_LIBRARIES})
   option(UEYE "Using UEye library" ON)
endif(UEye_FOUND)

qt4_wrap_cpp(MOC_SOURCES ${MOC_HEADERS})

add_executable(VideoSourceKinectDemo ${SOURCES} ${MOC_SOURCES})

target_link_libraries(VideoSourceKinectDemo
   ${LIBS}
   ${BTL2_LIBRARIES}
   ${BTL2_EXTRA_LIBRARIES}
)
